home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part2 / 13870 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1001 b 

  1. Path: crc-news.doc.ca!usenet
  2. From: Slobodan Celenkovic <Celenkovic.Bob@ic.gc.ca>
  3. Newsgroups: comp.lang.c++
  4. Subject: Re: Advanced C++ question...
  5. Date: 27 Mar 1996 21:39:57 GMT
  6. Organization: Industry Canada
  7. Message-ID: <4jccjd$2k9@crc-news.doc.ca>
  8. References: <4iprfg$1ui@aadt> <4iv31k$ch7@transformer.pti-us.com>
  9. NNTP-Posting-Host: bouhadrah.mohamed.bsd001.ic.gc.ca
  10. Mime-Version: 1.0
  11. Content-Type: text/plain; charset=us-ascii
  12. Content-Transfer-Encoding: 7bit
  13. X-Mailer: Mozilla 1.22 (Windows; U; 16bit)
  14.  
  15. Walt Dixon <wv.dixon@pti-us.com> wrote:
  16. >You might try something like this
  17. >
  18. >object& operator*(int);
  19. >object& operator*(int) const;
  20. >
  21. >the first being the lvalue operator, the second
  22. >being the rvalue operator
  23. >
  24. >
  25. >walt
  26. >
  27.  
  28. Actually:
  29.  
  30. lval or rval =>  object& operator*(int);
  31. rval only =>     object  operator*(int) const;
  32.  
  33. The 1st one returns reference so it can be used as either lval or rval, 
  34. whereas the 2nd one returns the object so it can be only used as rval. I 
  35. am not 100% sure though.
  36.  
  37.  
  38.